<?php

namespace IDock\Insurance\HBIC\Request;

use IDock\Insurance\DAJIA\Response\InsuranceOrderQueryResponse;
use IDock\Insurance\HBIC\Bean\BASEPART;
use IDock\Insurance\HBIC\Bean\CAR;
use IDock\Insurance\HBIC\Bean\CARSHIPTAX;
use IDock\Insurance\HBIC\Bean\CHANGEBASEPART;
use IDock\Insurance\HBIC\Bean\DEVICE;
use IDock\Insurance\HBIC\Bean\KIND;
use IDock\Insurance\HBIC\Bean\NOCAR;
use IDock\Insurance\HBIC\Bean\PERSONNEL;
use IDock\Insurance\HBIC\Response\CommonResponse;

class PolicyOrderQueryRequest extends AllHBICRequest
{
    protected $requestType = '249';
    protected $comCode = '2500000000';

    protected $methodName = 'queryPolicy';

    protected $resourceType = 'TYDL';

    protected $response = CommonResponse::class;

    protected $urlTip = '保单查询';
    protected $PolicyNo = '';
    protected $VinNo = '';
    protected $LicenseNo = '';
    protected $UwYear = '';

    public function generate(): array
    {
        $param = [
            'head' => [
                'requestType' => '0022',
                'messageId' => 'ebcd0efb-c435-43a1-8e2b-b9f7c13559e2',
                'userId' => '',
                'passWord' => '',
                'ComCode' => ''
            ],
            'body' =>
                [
                    'resourceType' => $this->resourceType,
                    'methodName' => $this->methodName,
                    'baseInfo' => [
                        'PolicyNo' => $this->PolicyNo,
                        'VinNo' => $this->VinNo,
                        'UwYear' => $this->UwYear,
                        'LicenseNo' => $this->LicenseNo,
                    ]]
        ];

        foreach ($param['body'] as $key => $val) {
            if (empty($val)) {
                unset($param['body'][$key]);
            }
        }
        return $param;
    }

    /**
     * @param string $PolicyNo
     */
    public function setPolicyNo(string $PolicyNo): void
    {
        $this->PolicyNo = $PolicyNo;
    }

    /**
     * @param string $VinNo
     */
    public function setVinNo(string $VinNo): void
    {
        $this->VinNo = $VinNo;
    }

    /**
     * @param string $LicenseNo
     */
    public function setLicenseNo(string $LicenseNo): void
    {
        $this->LicenseNo = $LicenseNo;
    }

    /**
     * @param string $UwYear
     */
    public function setUwYear(string $UwYear): void
    {
        $this->UwYear = $UwYear;
    }



}